modified from eclipse