added Ian's changes