restore commented logic code