Modified calculation of 't' to match serial code