change length of trial based on variable