changes according to @ericmj's comments