starting migrating over to pattern matcher...still has errors