 class Sprite
     #closures
     _list = []
+    _canvas = document.getElementById 'gh-canvas'
     _sortRule = (sp1, sp2) ->
         sp1._dis.level - sp2._dis.level
     _bounds =
-        top: document.getElementById('gh-canvas').height / 2
-        bottom: -document.getElementById('gh-canvas').height / 2
-        right: document.getElementById('gh-canvas').width / 2
-        left: -document.getElementById('gh-canvas').width / 2
+        top: _canvas.height / 2
+        bottom: -_canvas.height / 2
+        right: _canvas.width / 2
+        left: -_canvas.width / 2
     _boundaryCallback = (boundAction, side) ->
         #return appropriate callback function
         switch boundAction

        for own key, value of env.SPRITE_DEFAULT_CONFIG
            config[key] ?= value

        #filter out magnitudes and angles of vectors
        magnitudes = {}
        angles = {}
        for own key, value of config

            else if key.match /(^posAngle$|^motAngle$|^accAngle$)/
                delete config[key]
                angles[key] = value
            else if key.match /^ba_all$/
                delete config[key]
                config.ba_top = value
                config.ba_bottom = value
                config.ba_right = value
                config.ba_left = value

        #used to track asynchronous _update
        @_updateID = null

        #create primary objects
        @_pos = {}
        @_mot = {}
        @_acc = {}
        @_dis = {}
        @_bas = {}

        #create secondary objects
        @_dis.image = new Image()
        @_dis.context = _canvas.getContext '2d'

        #set this sprite's configuration
        #"virtually" calls child's set method in derived classes
