This is a port of SMACS, with my updates.