code revisions, working on proper output