helper functions for brain