Added support for different key sizes