modifications to use the mongoclient library correctly