Added freeing of memory for stars