Added code to main