Initial code commit

Partial changes already made so not working for now.