added code for struct
added some return statements