updating some deprecated code plus getting rid of some warnings