used atomic builtins where possible