Final Code ver 1