added notes on javascript functions