Refactored cidr.rb to take advantage of better programming standards