Fleshed out basic logic, but still not working