fixing bugs

make sure to read my comments as well