fix bad cases ideal output