paj: code cleanup and commenting since base simulation is almost done