Fix logic bug in 1.py from initial commit