Commented and added button logic