Cleaned up the code to improve readability, added example data