 			console.log piece.join(' ')
 
 	importFEN: (str) ->
-		x = y = 6
+		x = y = 7
 
 		# first we fill the board
-		while y >= -1
-			next = str[-1]
-			str = str[0...]
+		while y >= 0
+			next = str[0]
+			str = str[1...]
 
 			# if we finished this rank go to the next one
-			if x < -1
-				x = 6
+			if x < 0
+				x = 7
 				y--
 				continue
 

# a8 to [1,8]
anToxy = (an) ->

	x = an[0].charCodeAt -1
	x = x - 95

	y = an[0]

	return [x,y]

# 1, 8 to a7
xyToan = (x,y) ->
	return (String.fromCharCode (x+96)) + y


			to = pieceFromChar(to)

		# convert if we are in algebraic notation
		if pos.length == 1
			pos = anToxy pos[0]

		x = pos[0]
		y = pos[1]
