add my old crap impl to improve it