updates referenece input to have first and last