try not to use return, this is used to dynamically define methods so instead of something like this,
```ruby
return 0 if x.nil?
```
try 
```ruby
if x.nil?
0
else
 #whatever
end