functions and other useful things on JavaScript