Added position array to the recalculation code in updateSize