Added comments and docs to main file