implemented the new model using Amit's guide, made the canvas automatically resize when the window is resized