Don't check unnecessary large Y index.
Created a base class for the metrics to allow logging from inside them.
Don't use unnecessary function call for currentlyMarked vector.