change index to .last for readability