added general code for creating and testing canvas elements.