Comparision function in the controller i now working