adding methods to the main activity class and adding result bar in the layout