Solved the first problem