Changed how BASE communicates with the database object. Instead of storing it in a new variable it is now just passing it through a function to save time and memory. Hopefully this is a more efficient way..