Fixed errors and refactored code. Removed sample data.