changed threshold operator from :< to :<=