added debug function to help debug incoming data. also fixed z-issue on login, as per #9