there's a lof of fanciness here, needs a comment explaining how it works.