rewrote some things