working on block validation function