Removed messy code, updated documentation