migrate math to processor.rb