completed homework4.rkt