last logic error (hopefully)