pretty much done, needs cleaning up probably