Removing debug comments & add foreground option