A bunch of changes to make a live demo easier (on JsFiddle)