change originally by joequant, merged into thsi version of the file for simplicity