added elbow method