Fixed list not updating length after pop
Added operator precedence