setting cur=goal when closeenough