almost finish, has some syn errors to fix