updated with changes from sj