Registration script

registration script, think comments will tell you how it works :)