preparing to merge into master, making more generic