lastone function complete