Now using a buffer instead of recalculating absolute indices
Way more refactoring of objects, optimization, and splitting of stuff into functions