made flash code less ugly