KJ edits

adjusted import statements, added lots of code, reorganized "main"