adding a lot of the basic code. No testing yet