Refactored and deleted extra code for final product.