Solved the first three exercises. Too tired to do the fourth one.