Made tweaks recommended by Tom Shen