Added secondary function implementation

Added an implementation for the secondary function.