Renamed variables and altered the keep statements.