crappy solution that takes too long