Likely one or more of those three } s needs to be deleted. Every { must have a matching } lower in the code. The ide normally indents correctly (the forum here screws with the indenting making it hard to debug). When it says updateShiftregister isn't declared it means it found the ending } before it should have (likely because there is one too many of them).
Peter