removing debug functions; reformatting source code