Added heuristic for beside, leftof and rightof.