tidy up of code

names shortened, some comments added;
also book-keeping in transition matrix code made clearer