change data structure that describes curve: object instead of array