now avoids overwriting data, more portable