working and fixing bugs