added common variables for file paths, cleaned up the code and added more comments