sweet jesus i spent way too much time on this