added handling for negative integers