finished core logic
tests for core logic