Regular JS works with draw, ready for transition to angular