Solved first problem. Should be wrong