added code logic