Completed problems 1 and 2

Here's homework #4!