finished solver code (for the most part); need to finish readfile()