take out fitting part of the code