better size detection