updated function with types
added & to run command with parameters
modified message for file deletion