Update core.rb

better if statement