added buttons and loc function