Removing $last=last_run(?) if/else statement