Cleaned up codewith commenting