broken, but easy fix in ruby