Ugly spaghety non working code for update of Google spreadsheet - rework needed