ram write (not yet finished)