add storage functions for mag