fixing bugs on client side. correct calculation of numMats
Merge branch 'master' of https://github.com/csherland/ducking-octo-hipster