Fixxed some code/simplified