changed wimp.py according to the changes suggested by jaime