Works, exponentiallly slow, gonna have to fix that