Our first (very inefficient) attempt at an SMA