Added variable size support