Revert "Revert "Solution to assignment 2""

This reverts commit d743f722996383e7cce9d206b67b7694b88ccfcf.
Solution to assignment 2

Final draft