cleaning up the elements and adding documentation