Modified the functions