// look up the data

var objectData = EB. objectData [ dataIndex ] ;

if ( objectData )

{

++ dataIndex ;

var info = objectData. value ;

// since topOrLeft has precidence, check that one first!

// if the current topOrLeft has NOT been completed

if ( ! completedFormulas [ formulaIndex ] [ TOP_OR_LEFT ] )

{

formulas [ formulaIndex ] [ TOP_OR_LEFT ] . data . data = info ; // append numeric value to it

$ ( formulas [ formulaIndex ] [ TOP_OR_LEFT ] . container ) . removeClass ( 'blank' ) ;

completedFormulas [ formulaIndex ] [ TOP_OR_LEFT ] = true ; // set it as completed

}

// if the current botOrRight has NOT been completed, append numeric value to it

else if ( ! completedFormulas [ formulaIndex ] [ BOT_OR_RIGHT ] )

{

formulas [ formulaIndex ] [ BOT_OR_RIGHT ] . data . data = info ;

$ ( formulas [ formulaIndex ] [ BOT_OR_RIGHT ] . container ) . removeClass ( 'blank' ) ;

completedFormulas [ formulaIndex ] [ BOT_OR_RIGHT ] = true ;

}

else

console. log ( "Unable to find an uncompleted formula." ) ;

}

else