switched W(theta) to a map and added exception