Code tested and working correctly