add the code, the code is still not parrallelized and overly bad