added documentation and moved things