Changed layers to operate on double values