encapsulate local functions
added option to print help page