bug in productivity function