Unsure why output isn't being passed