obsolete periodic codes removed. Anh's code will replace this soon.