Solution for assigment 2