small edits and unused function outcommented.