First version of the project, a bit messy but still working