Changing the SMA functions to have RO-variant.
Adding palette as suggested by Nick.