improved custom atom example