added base functionality, some tests