added gagewatershed function and changed makefile