seg fault fixed, updated