           rotation: @rotation
       
         
-    blockPosition: (blockNumber) ->
-       definition = @shapeDefinition(this.rotation)[blockNumber]
+    blockPosition: (blockNumber, rotation=null) ->
+       definition = @shapeDefinition(rotation || @rotation)[blockNumber]
        x = @x + definition[0] 
        y = @y + definition[1]
        {x: x, y: y}
     
     canMoveDown: ->
-      test = Tetris.height - 1
+      floor = Tetris.height - 1
       for i in [0,1,2,3]
-        return false if @blockPosition(i).y == test
+        return false if @blockPosition(i).y == floor
+      return @canMoveTo(0, +1)
+      
+    canMoveTo: (xOffset, yOffset, rotation=null) ->
+      for i in [0,1,2,3]
+        x = @blockPosition(i, rotation).x + xOffset
+        y = @blockPosition(i, rotation).y + yOffset
+        console.log(x,y, Tetris.blocks.contains(x, y))
+        return false if Tetris.blocks.contains(x, y)
       return true
     
     draw: (c) ->

    keyDown_38: ->
      return unless @owned
      if @rotation is 3
        @rotation = 0
      else
        @rotation += 1
      @moved()

    # RIGHT
    keyDown_39: ->
      return unless @owned
      @x++
      @moved()


    # LEFT
    keyDown_37: ->
      return unless @owned
      return unless @canMoveTo(-1, 0)
      @x--
      @moved()

