cleaned up a bit of the code, still might need some re-structuring