ported files from flashoff-web