This should probably take the duration as a parameter