more work on logic