changed types in algo to fixed bit integers