Solution for the assingment