Clean up of unnecessary clutter, using sed instead of some arbritrary function
Also removed useless variables and added a check to see if a file was specified
Note: We don't need to clutter the environment