added google test unit tests and debugged