added wall detection and some new bugs..