BruteForce logic implemted for lab1