simplification suggested by shivawu