removed Peter's code, updated with new javascript