Added support for multiple values and added in locking mechanisms to ensure no data-races.