removed triallength variable