fixed loop point boundary checking
swapping in a BiMap for tracking resources