added used block check and detection
retrieval script implemented
refactored out redundant para used code