The math behind the game of Tetris