File handling part written