Fixing some issues and working with the code