Added solution calculation