Initial implementation code and tests