Cleanup + added documentation inline