add some logic for manipulate blocks.(not finished)