Changed methods to public

For JUnit testing
Added JUnit test file