properly calculates the size of the lights array