it's dirty but it works