first commit
more updating needed... for example first prev arr
moved where we update the array