Final solution to integer parsing problem