Added code for some of the first layers. Untested.