Added the rule functionality too. Still got shit to debug, dayum.