Finished main part of code and added some examples.