all offsets changed to uint, most functions acquire from parameter