Fixed a small bug in the times that I was asking for references
at.... could still be slightly wrong, but appears to be working in sim