added initial functionality, tests