Achieved more functionality on hw 4