Logic almost done