Right logic wrong place