Implemented helper functions for right-justify function in HW2