reverse layers ordering