added bunch of error checks to shapes demo