finalized for 500k step optimization