updated based on comments from cantino