added writecode file and started writing functions and made changes to other files