removed bugs and added some stuff