Added test files and made unit tests