Updated the example and added intersection detection to canvas class