Added missing docblocks and fixed alot of whitespace and nesting issues