reading writing from files, hence more efficient