added new code and ogranized everything