Merge pull request #1 from ekg/master

cleanup
bug fifed (nan in xpehh and ihs)
change shebang to use env (more flexible)