rewrote classes