functions that help make writing javascript easier