Implented bitflags in a ridiculous way that took me way too long