Java implementation of tetris