wrote split integer method