some changes from stevelosh