rename and reorder functional prototypes
modify function definitions to match prototypes
use new function names
rename one more function
added clean make target