fixed t4q7 and added a test program for it