Adding reverse function instead of hardcoded