Updated documentation
Cleaned up code, fixed issue introduced with last change