UPDATE: Code actually works.