wait until document is ready before running functions
add a couple actions for increased flexibility