Added delay function and basic file functions