Added a block funtion.