added junit tests and removed extra methods