added solver class, still simple implementation but seems to work fine