Added Inner function and test

I guess it doesn't matter if we're using the multiplication anyway