Final version for now
Declare vairable types etc, and the write to database table