first try for implementing --depth for register