accepting suggestion to use rsplit