Added first version of file function