Final code changes, little fixes and some documentation