fixed syntax, bugs