pset2 solved.
later versions to incorporate the brute force methods.