Added Unit Test and fixed syntax errors