fixed bugs, added 2nd test program