updated to fit working model