cleanup, more comments and fix minor errors