Updated documentation. Merged with Alex's