fixed it up to be more generic