added some missing things and fixed some issues