Made the code compile and documented it.