final version. all register checks working properly.