constructor returns pointer instread of struct