logic for blocks now done