added struct and changed class constructor