updated run lines and fixed readRecord