updated Functions and Methods in JS