modified initialization of blocks and added click function