Calculating The Number Of Steps Needed