added logging, fixed counting bug and made names more legible
fixed typos
code cleanup