Add more files and update documentation

I added the code and documentation for problem 4 and updated the code
and documentation for the previous problems. I also added "*.tmp" to
the ".gitignore" file.