Head Cropper written as a function

Head Cropper written as a function
and wmax and hmax bug fixed.
CNN and DCNN files as functions

files written as functions; Minor code changes