java code, time update, and u matrix