Updated logic. Still not working.