Updated to do what it actualy was supposed to do