adding basic javascript skeleton and functions