updated for clang compatibility