Structural Motifs Using Random Fields, stochastic search implementation in Haskell