WORKING VERSION OF STATE 40