Alternative is just assuming the base directory in this function. I could do that, it felt cleaner this way but I'm happy either way.