part 3 working, still need to clean the code and maybe look for a better way