when I run the calculator tests against your code, I get 4 failing tests for sum and multiply. With flatten, you don't have to check if it is a multi-dimensional array. try taking out the check for is_dim in your code and see if they pass for you.