check to see if file exists and some style cleanup (can't make up my mind)