Refactored everything, wrote some notes