how does a star's mass affect its lifetime?​