Updated the structure of the code and made the thing work