this took wayyyyyy too long