Added documentation to main form functions