testing some of the internals
some more function has been refactored
lots of functions were cleaned up accepting parameters
remove prototypes; remove return undef