god damn, this is too complex :/