tidy code and fix speed
Merge pull request #15 from edisonout/intro_tweaks

tidy code and fix speed