Added init method for blocks, and cleaned up some dirty code.