changed duration to double