Work started on watershed main function