Fixed a bug in layer generation. Added layers!