updated
minor fixes.
removed unused code.