final solution to assignment