Create function for each doe block