goal chaining reimplemented