Completed the functionality without UI