code formating
code formatting: fixed block comments
code formatting: line continuation indentation
remove functions that are duplicates

One of them had two different implmenentations.
comment out unreferenced code
don't shadow function argument variable k
minor formattings change