hw5 tested working properly