exercise 3 done. Props to duboff