added updateCubes function
Merge pull request #43 from nicmitchell/master

added updateCubes function