class project using threads in java and matrices