added overall description and commets describing functions.