added layout and flash support