added 2 functions for direct file handling