Update: Corrected programme with creat & open calls