Modified getct.m to handle replicates a little better