Documentation

Commented a lot of code and added a readme file.