Removed glaring logic error