added code from eclipse