add key size adjustable function