Finished the second problem, it works!