Now recreates
Now fits pedestals with function and saves function to file
Still need to account for pedestals