Logic

Added logic