Added Inner function and test

Add license header.