added more functions of randomizeFunc, determineTimeLength, update