small changes to syntax and bug fix