added some more code for functions and arrays