better error msg, more mystery functions