updated JavaScript Cloure and Prototype