crude File handling done,code needs a lot of improvement and modularity