Cleanup and added documentation