finished first version of toObject() methods