removed double pointers, has runtime errors