off by one because of inexperience with lua