added duplicate function

streamlined beginning
misc changes and adaptation to the GSC server