Code added for wall tracking
Semi-stable version