implementing new method that can handle missing data