This is horrible, but it works