fixing bugs, increasing flexibility