created views and changed the logic a bit