Rewrote some things and added stuffs