created documentation and separated functionality

created documentation and separated functionality  into different
classes