First public update

Updated the full code, needs reviewing
Minor fix