Added more flexibility in the way we compute the start and end of previous/next/current states. It allows for trials that only have 1, 2, or 3 states; ie incomplete trials