changed solution to use already-existing code for all py 2.x