wow some powerful function!!!
takes a while to read the whole syntax