Added performance control - Credit to Mahdi