added statistics and added Wall flag