Minor changes in logic