Figured out bunch of magic