fixed a things and added a clause