Adding Canvas Element & algorithm code