Added BSD license to this code