Correcting bugs and  bad method implementation. There are multiple
warning still but the code is compiling.