Add tests and re-work implementation