fixed solution to hw1 pr 1 and solved pr 2