Cleaned up the dimer code a bit and gave it arbitrary-length wordcounting