Homework3 rework