Added a lot more logic