adding the main bulk of the code