added some comments; handles extra properties;