updated abstracted slightly