do more precomputing and divide train into two phase