Added documentation
Added comments
Fixed build order