added end boolean

and changed the way # of missed work