Added JUnit Test

Wrote unit tests and minor enhancements