Fixing syntax errors
Fixed logic error.