hw6

second part takes a very long time