restructuring and adding documentation