Added Block state and animation. Code refactoring.