changed syntax for atoms to use idiomatic flow control