cleaned up use of .to_i