use int32_t and stuff..rm some dead code here and there