brute force solution, will take too long to execute