Cleaned up shallow clone implementation

Made some variables more private.
Removed unneeded variables.
Added more javadoc comments.