all functioning code.Needs commenting is all