Code is under major reconstruction ( again ) to fit standard coding practices I have looked up online.