tweaking and fixing bugs