updated code for occurs-bound