updated documentation + code cleanup