What are the factors affecting flexibility of a joint?