added some dialog stuff. lots of commented code.