code cleanup, cleaner output, more comments