First pass at the logic implemntaiton