final debugged version of acute experiment