Main Function writes values to database

added lines so that main function can write the read values to the
database. Still need to create port to name function.