converted to javascript and transfered to blog