Optimal dynamic environmental policies of a profit maximizing firm