Before rewrite
finish 1d
Finish 2d
bugs
Merge pull request #5 from lukeqsun/master

Final code