add tests for #18
it seems there are some issues with calculations