How to use blocks in functions i.e blocks:function