left out max-duration, oops. also tidy up