used pyCharm to clean up the code