Updated syntax and fixed a couple of bugs