attempting to fix my bad python code