first attempt at smsa_write