Added logic comments