Added State class, cleaned algorithms