cleanup, better test, added descriptive comments