Works done for Stat 523 "Statistical Programming" at Duke