added code, tests