adding tests, improving the code
Merge remote-tracking branch 'origin/master'