Added methods and upgraded code