Made code compile, but with warnings WIP