planning js functions