starting implement js functions