tidied some declarations and set symbolic breakpoints to track down malloc errors.