done. also bugfixed variable scoping error w/ java script code