One comment: Do not use "==" in comparing strings:
use [string equal ..] instead of [string match ...]
/Lars