Added kup's encode program for testing.