Credits ------- Kirill Simonov - for writing the original Python code.