added simple comments to the functions and routines