Eliminating duplicate code. Canvas will now expand to fit.