Lowered visibility of functions and added basic documentation