#9 - done
#2 add optimize table
#16 - added