---implemented wk theorem in time only. This code is working.