Implemented/fixed brute force solve algorithm