Modified original script to include mouth detection