Made proposed changes and brute force solution implemented