Extended code documentation (unbuilt)

Whitespace fixes, added code explanation details