trying to figure out why it freezes