Code-cleanup and Documentation adding