remove warnings
rewriting to remove deprecation and update