adapted to 4096 and a 5x5 grid