North South algo working