major bug fixed in motif.py