update code as per javascript, change to camelCase