moved from bool exit check to int
fixed bug if no items provided