Use size function instead of manually calculating it.