Fixed freezing error. Need to work on efficiency.