this has to be the worst way to do it.