Use array map for simple stuff.
Add documentation and missing function parameters.
Merge pull request #3 from bar/patch-1

Use array map for simple stuff.
Merge pull request #6 from bar/docs

Add documentation and missing function parameters.
Remove unneccesary assignments.
Merge pull request #5 from bar/patch-2

Remove unneccesary assignments.