Canvas and other improvements

Using canvas instead of duplicate element, improvements to function calls and addition of close method