Writes values to table