added detect wall funtion
added detect_win function
updated comments for detect_win function