Reworked solution