can also read from file
code factorized