changing read function and creating markers in text file to advance array and delimit pixels and frames