syntax fixes and updates to functions