defined some externs
cleanup