Cleaned up
Added debug logs