Tested both codes with different variables