Use an array instead of a map for keeping track of the location of each block.
Introduce class to encapsulate method parameters.