Further updates to canvas js code