Solved the HW but now just needs to be formatted to look nice