On the formation of sand waves and sand banks