From internet function, flipped tree upside down and made stable. Source: http://thecodeplayer.com/walkthrough/create-binary-trees-using-javascript-and-html5-canvas