Works but a lot of deprecated code