improvements here and there, homework for week 8 & 9