Removed unnecessary piece of code and fixed some syntax errors