Adding block function