Major refactor... feeling really dumb for previous implimentation