add logic code