Updated documentation accross the whole code base and other minor fixes