Reworked solution again