Updated logic and names