Integrated both clicking code