Updated haskell algorithm code

Updated haskell code for algorithm development to implement more efficient algorithms and avoid duplicate sets