solver funciton now writes solution to DOM