replaced if with while in latencyRegistry - hopefully it eliminates NaNs
Changed if to while in both projects as well