Tim wins with final lap effort