added unit tests
added pre-commit test