up to problem 6, starting to do some in python