now working
working version with read file