Logic change for secondsol