Made it more general