initial commit with working version. need to modify 3rd one