wallDistance() method added and some xbox code added