fixed most warnings and deprecated code