Initial version of assignment

Added required comments.
Adapted code from 'cacheMean'