rewrote a bit of the code