modifying some stuff and some bug fixes