max layers changed to 4, by @saleiva