Added chain solution (in functional style) for task #1
syntax fixes