Reduce repeat pops and pushes
Add popN function
Use bind operator
Merge pull request #9 from swtw7466/reducerepeats

pop と push を減らしてみる