Solution for problem SUBS