tests: initial logic and tests