add support for ratios

Still getting those. Looking at the the debugger, there are some NaN values in being returned:

https://www.evernote.com/shard/s78/sh/c8c88720-c388-4a68-adea-05d7486a85f4/5fd1b585e84f156523d1a61d649470ff