organized code and added section comments