Fix the order of testing and training during pipeline. Make sure that testing happens after pipelined training is completely done.
Get rid of unused variables.
Get rid of unnecessary thread.sleep