         @_dis.translate @_pos.x, -@_pos.y
         @_dis.rotate -@_pos.a
         
-        #find current frame
-        sx = (@_dis.cycles[@_dis.current].frame - 1) * @_dis.cellWidth
-        sy = (@_dis.cycles[@_dis.current].startRow - 1) * @_dis.cellHeight
-        
         #draw frame
-        @_dis.context.drawImage @_dis.image, sx, sy, @_dis.cellWidth, @_dis.cellHeight, -@_dis.width / 2, -@_dis.height / 2, @_dis.width, @_dis.height
+        @_dis.context.drawImage( 
+            @_dis.image, #spritesheet
+            (@_dis.current.frame - 1) * @_dis.cellWidth, #sx
+            (@_dis.current.row - 1) * @_dis.cellHeight, #sy
+            @_dis.cellWidth, #swidth
+            @_dis.cellHeight, #sheight
+            -@_dis.width / 2, #x
+            -@_dis.height / 2, #y
+            @_dis.width, #width
+            @_dis.height) #height
         
         #restore context
         @_dis.context.restore()
     _update: =>
-        if @_dis.timer.getElapsedTime() >= Math.ceil(1000 / @_dis.frameRate)
-            if @_dis.cycles[@_dis.current].frame < @_dis.cycles[@_dis.current].numFrames
-                @_dis.cycle[@_dis.current].frame += 1
+        if @_dis.timer.getElapsedTime() >= (1000 / @_dis.frameRate)
+            if @_dis.current.frame < @_dis.current.numFrames
+                @_dis.current.frame += 1
             else
-                @_dis.cycles[@_dis.current].frame = 1
+                @_dis.current.frame = 1
             @_dis.timer.restart()
         super()
-#end class AniSprite+#end class AniSprite

        @_dis.timer = new Timer()
        
        #push provided cycles onto the array
        for own key, value of config when key.indexOf("cycle") is 0
            key.name ?= key.slice 5
            @_dis.cycles.push(new AniCycle(value)) 
        
        #call Sprite constructor
        super(config)
        
        #return this
        this
    
    #getter
    get: (what) ->
        #add later
    
    #setter
    set: (what, to) ->
        #add later
    
    #changer
    change: (what, step) ->
        #add later
    
    #animation control
    play: ->
        @_dis.timer.start()
    pause: ->
        @_dis.timer.pause()
    
    #update routines
    _draw: ->

class AniCycle
    #constructor
    constructor: (data) ->
        #extract data
        @frame = 1
        @name = data.name
        @row = data.row
        @numFrames = data.numFrames

class @AniSprite extends @Sprite
    #constructor
