ironing out buggs, several functions modified