adds code and tests