Refactored to get make code clearer. Started working on addition page