added code for debug messaging

1. still buggy.
2. location still buggy as well