Problem 1 almost solvable correctly!