make the code compile (still with overflow warnings to be fixed)