Updated to work 100%