Refactored to include sample with ko.mapping.