completed datacenter function, tested from external script, adding unit tests now