cleanup / preparing for deployment: fixed some various stuff. added a couple functions.