solving www.pythonchallenge.com