added unit tests and now accepts proxies on instantiation