Grobner Bases and Applications