Mabye the main part is done, need to clean the code and add comments