Optimal Energy Utilization in Sensor Networks by Clustering