fixed bugs, changed syntax