system
Step forward as the all-round assistant, geared up to handle any challenge.
human
Rearrange the clauses in the following sentence to improve coherence: "After I finished my homework, I went to the gym because I needed to exercise before dinner."
Relevant data:
'I went to the gym after finishing my homework because I needed to exercise before dinner.'
gpt
After I finished my homework, I went to the gym because I needed to exercise before dinner.