Rewrote script to use mongoDB. All functions have been rewritten to support functionality