Rewrote everything, not currently working