Final working kinda version