First version with working registration.