messy code but one patter is done. Now I would need to work on multiple scenarios