added copy feature and cleand up a little