Changed some loops to use querys
Temoraly set 20 as the max number of points in every element subclass
Reverted previous commit. Flush operations are done now over the table instead of using the interan row _flush