simplified histrange calculation, added help