remove duplicate, some syntax fixes
remove duplicates
syntax fixes