fixed many register bugs, removed debug