Complete rewrite from iris-light code, which was a complete rewrite from numix, fixed many bugs