its disgustingly ugly, but it works