rewrote lost code D: