code satisfies conditions, need to add comments and create functions outside of main