Added basic solve algorithm