updated to work with new SH functions