got readfile implementation working