added block calculation routine