added tests and basic code