works without pointers