Improved documentation/comments
Small code tweaks