wrote getindex and setindex functions for SALT.Mode