added test for adding items

refactored resize to use while loop over the coffee-script generated
for-loop