refactored

cleaned the code up and removed testing material