Solutions for first three challenges