added rank method
made code improvement
Merge pull request #10 from jakrin/master

added rank() method