Got an alpha version working. Rules definitely can use tweaking