minor updating of main script, allow trial overlap