Implementing Jason's function in place! --kazu