implemented shawn's comments.