What are algorithms and how do they work?