drafted the base functionality for Tilecoder, going to finish and refactor tomorrow