Learned that php has some built-in functions for getting filenames and extensions. Utilize that and add some features