separate getOnscreenBlocks() into own function