fundamental funtions and file operation