Self-reviewed code and cleaned up
Added documentation