code cleanup, indenting, debugging