duplcation is working. cleaned up code and removed redundant logging