Simplify & beautify the code by using `nan`
Merge pull request #6 from myl2821/master

Simplify & beautify the code by using `nan`