R6RS A-Star implementation