Freeze detection algorithm works

in the process of building the database