Improves asInt for problem 2 (pg. 98)