Added register logic stuff