Broke up code into package. Work needed. Very ugly.