refactored tetris