updated logic, almost done