register logic, not finished

Signed-off-by: Alexander Skjolden <alex@plastboks.net>