build logical stack