substantial syntax improvements, and bug fixing