modified output and cleaned up code from original
Merge branch 'testcode'