Final commit

Fixed logical errors and build errors and finalised assignment