Code used to solve HW