added more documentation. Cleaned some stuff up