improved int conversion