rewrote stuff