fixed #3 and fixed #4. Removed log statements