Working, terrible code