Initial code 

Lets hope it works with no kinks