various things: see extended descript

Updated main function, (replaced for loop in subgeenrations with while
loop is only major thing)
modified how updatecells and update unrefreshedcells work