Added basic code + test cases.