My code, not efficient tho