This actually almost works but is slow as a snowball