hw4 - remake of hw2 without framework done in hw3