Updated to correct an error in REGEXP and file endings