consolidated one ruby equation