Implement sequence
Implement flatMap
Clean up code