init version migrated from my first experience with html5 canvas