corrected a major bug in leap index computation